-
-
Notifications
You must be signed in to change notification settings - Fork 624
feat(#2369): Add webdev_colors_folder
option
#2375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm happy to use the same one for open vs closed. The user can see the state via the arrows or indent markers.
We can follow the file pattern i.e. create a |
We do have an issue: folder icons will appear for users when they didn't previously. We need to preserve existing behaviour. There are really two questions for files and folders:
For 1 we have no solution, which I think #2361 is about. The only way to prevent icons is to disable the plugin. Proposal: add options: We will need to add a silent refactor of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the contribution; this will resolve a larger problem.
Isn't this controlled by the new |
Many thanks for the updates. I'll get to this on the weekend. |
I'm scope creeping here. We never had any mechanism for controlling the display of icons, just their colour. We require both controls for folders to prevent breaking existing folder icon behaviour. We should add both controls for file icons now, as the configuration and behaviour would be very inconsistent between files and folders. |
Still not sure what you mean, if you use
Maybe splitting it into two options like |
Yes please. Please Don't worry about the migration; I'll do that after you've finished the functionality. |
I applied the patch and implemented |
That's fantastic! I'll get to this on the weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works beautifully:
file = { enable = false, color = false, }, folder = { enable = false, color = false, },
file = { enable = false, color = false, }, folder = { enable = false, color = true, },
file = { enable = false, color = false, }, folder = { enable = true, color = false, },
file = { enable = false, color = false, }, folder = { enable = true, color = true, },
file = { enable = false, color = true, }, folder = { enable = true, color = true, },
file = { enable = true, color = true, }, folder = { enable = true, color = true, },
file = { enable = true, color = false, }, folder = { enable = true, color = true, },
renderer.icons.webdev_colors -> renderer.icons.web_devicons.file.color
Many thanks for your contribution, you have gone well beyond the call of duty.
…devicons.file.color
Implements feature #2369
I started writing a little draft to provide an option that allows the user to change the icon and color of a directory based on its name. I added a new option
webdev_colors_folder
and I changed theget_folder_icon
function as mentioned here. Now you can do this:And get this result:
Click to show screenshot
But I have some questions before continuing.
nvim-web-devicons
doesn't distinguish between directories and files, so if you create a file that matches one of theoverride_by_filename
keys it will get the same icon and color, which maybe you intended only for directories, not files. I am not sure how to override only directory names.On the other hand, what should happen with overriden icons when the directory is open VS closed? Should it use the same overriden icon for both cases, use the overriden icon only for closed directories while using
glyphs.folder.open
for open directories, or should it allow the user to customize both closed and open icons/colors? I think the last option is not possible withoverride_by_filename
asnvim-web-devicons
doesn't know whether a directory is closed or not, that is handled bynvim-tree
.Finally, I'm not sure if
get_folder_icon
should return both the icon and highlight or if there should be an equivalent toBuilder:_get_highlight_override
, I implemented it as simply as I could.